home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Inspectors / InspectMe / ThingInspector.h < prev    next >
Text File  |  1995-06-12  |  3KB  |  72 lines

  1. // ThingInspector.h
  2. // By Kevin Brain (ksbrain@zeus.UWaterloo.ca)
  3.  
  4. // ThingInspector is responsible for the Thing1 and Thing2  
  5. // (Tank) attribute inspector views. 
  6.  
  7. // This class is an example of a class that is responsible for
  8. // a set of inspector views in an application.  Such classes 
  9. // act as intermediaries between the controls of inspector
  10. // views and the currently selected object.  These classes
  11. // have outlets to each control in the inspector views it is 
  12. // responsible for, and methods that act as the targets for 
  13. // each of these controls.  This intermediary class is
  14. // necessary because the application can have more than one 
  15. // "inspectable views", each which may be "inspected" on a 
  16. // particular "inspector view", so we don't directly connect
  17. // the inspector controls to the actual object that the control
  18. // is currently affecting.  Instead, the controls are connected
  19. // to the inspSet{*} methods of this class, and these methods
  20. // send a corresponding message to the object itself.  They do
  21. // this by sending the message to the 'currentParameterReceiver'.
  22. // This means that a setCurrentParameterReceiver: message must 
  23. // be sent to this class when a new object is selected to set 
  24. // the object as the currentParameterReceiver.  (Another option 
  25. // is to have the inspSet{*} methods find out the currently 
  26. // selected object (somehow) at the time it is invoked.)
  27. // The reflect{*}Attributes: methods reflect the attributes of an
  28. // object on the controls of a particular inspector view.
  29. // The {*}InspectorNum methods return the inspector number 
  30. // assigned to the inspector when it was given to InspectorManager
  31. // in the setupInspectors: method.
  32. // Notice how this class is set up to have only one instance in 
  33. // an application.  After the first instance of the class is 
  34. // created using the 'class method 'new', subsequent calls to
  35. // new return a pointer to this single instance.
  36.  
  37. #import <objc/Object.h>
  38.  
  39. @interface ThingInspector:Object
  40. {
  41.     id    thing1InspectorBox;
  42.     id    tankInspectorBox;
  43.     id    currentParameterReceiver;
  44.     id    inspectorManager;
  45.     
  46.     int    thing1InspectorNum;
  47.     int    tankInspectorNum;
  48.     
  49.     id    outNumber;
  50.     id    outSize;
  51.     id    outShape;
  52.     id    outCapacity;
  53.     id    outHolding;
  54. }
  55.  
  56. - setupInspectors:(id)mainInspector;
  57. - setCurrentParameterReceiver:(id)newCurrent;
  58. - (unsigned int)thing1InspectorNum;
  59. - (unsigned int)tankInspectorNum;
  60.  
  61. - reflectThing1Attributes:(id)theObject;
  62. - reflectTankAttributes:(id)theCycle;
  63.  
  64. - inspSetNumber:sender;
  65. - inspSetSize:sender;
  66. - inspSetShape:sender;
  67.  
  68. - inspSetCapacity:sender;
  69. - inspSetHolding:sender;
  70.  
  71. @end
  72.